<?php 
header("content-type:text/html;charset=utf-8");
$uname = $_POST['uname'];
$age = $_POST['age'];
$money = $_POST['money'];
$dsn = "mysql:host=127.0.0.1;dbname=goods;charset=utf8";
$pdo = new PDO($dsn,"root","root");
$sql = "insert into imports (uname,age,money) values('$uname','$age','$money')";
// var_dump($sql);die;
$res = $pdo->exec($sql);
if ($res) {
	echo "<script>alert('添加成功');location.href='show.php'</script>";
}else{
	echo "<script>alert('添加失败');location.href='add.html'</script>";

}


 ?>